/**
 * 
 */
			
$.deleteImage = function (fileNameArea, imageArea, addArea, deleteArea, infoArea) {
	var fileName = $(fileNameArea).val();
	if (!(!fileName || fileName == "")) {
		$.post(
			"DeleteFile",
			{
				deleteFileName: fileName
			},
			function(data, status) {
				if (data.resultJson.success) {
					$(fileNameArea).prop("value", "");
					$(addArea).show();
					$(deleteArea).hide();
					$(infoArea).text('删除成功！请重新上传');
		        	$(imageArea+' a').prop('href', '');
		        	$(imageArea+' img').prop('src', '');
		        	$(imageArea).hide();
				} else {
					$(infoArea).text('删除失败！');
				}
			});
	}
}

$.checkElement = function(validator, target, icon, status) {
	if ($(icon).hasClass('sr-only')) {
		$(icon).removeClass('sr-only');
	}
	if (validator.element(target)) {
		$(icon).addClass('glyphicon-ok').removeClass('glyphicon-remove');
		$(target).parent().addClass('has-success').removeClass('has-error');
		$(status).text('(success)');
		return true;
	} else {
		$(icon).addClass('glyphicon-remove').removeClass('glyphicon-ok');
		$(target).parent().addClass('has-error').removeClass('has-success');
		$(status).text('(error)');
		return false;
	}
}
			